<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Manipulate Products Sample - DML Operations for LOB Columns
Through ODP.NET Using C# - Readme</title>
		 		
  <link rel="stylesheet" href="otn.css" type="text/css">
</head>
	<body bgcolor="#ffffff">
<a name="SAMPLE_NAME"></a>
<table width="100%" align="center" height="2669">
  <tbody>
    <tr>
      <td width="100%">
      <h1 class="heading1"> Manipulate Advertisements Sample - DML
Operations         for LOB Columns Through ODP.NET Using C#</h1>
      <h2 class="heading2">Table of Contents</h2>
      <ul class="list">
        <li><a href="#objective">Objective of the Sample Application</a></li>
        <li><a href="#overview">Overview of the Sample Application</a> </li>
        <li> <a href="#usernotes">User Notes with Screen Shots </a></li>
        <li><a href="#software">Required Software</a></li>
        <li><a href="#extract">Extracting the Sample</a></li>
        <li><a href="#database">Database Setup</a></li>
        <li><a href="#prepare">Preparing and Running the sample</a></li>
        <li> <a href="#descsamples">Description of Sample Files</a></li>
      </ul>
      <table border="0" width="96%" height="15">
        <tbody>
          <tr>
            <td width="62%" height="19">
            <h2 class="heading2"><a name="objective"></a> Objective of
the Sample               Application</h2>
            </td>
            <td width="38%" align="right" height="19"> <a
 href="#SAMPLE_NAME" class="paragraph"> Back To Top</a> </td>
          </tr>
        </tbody>
      </table>
      <p class="tabletext">The purpose of this sample application is to
demonstrate:</p>
      <p class="tabletext">1. How to perform DML operations on <code
 class="nocolor">DataSet</code> for LOB (Large Objects) columns like
images, sound files etc.through ODP.NET         using C#?</p>
      <p class="tabletext">2. How to fetch BLOB data using <code
 class="nocolor">OracleBLOB</code> (ODP.NET type) and <code
 class="nocolor">OracleDataReader</code> through         ODP.NET using
C# ?</p>
      <table border="0" width="96%">
        <tbody>
          <tr>
            <td width="62%">
            <h2 class="heading2"> <a name="overview"></a>Overview of
the Sample               Application</h2>
            </td>
            <td width="38%" align="right"> <a href="#SAMPLE_NAME"
 class="paragraph"> Back To Top</a> </td>
          </tr>
        </tbody>
      </table>
      <p class="tabletext">ODP.NET offers faster and reliable access to
Oracle         Database by using Oracle Native APIs. ODP.NET provides
features to access         any .NET application. The data access
through ODP.NET can be done using         a collection of classes
contained in <code class="nocolor">Oracle.ManagedDataAccess</code> assembly. <code
 class="nocolor">Figure 1.1</code> describes how data is accessed using
 ODP.NET.&nbsp; </p>
      <p class="tabletext"><img src="images/tech2.gif"></p>
      <p class="tabletext"><code class="nocolor">Figure 1.1: Accessing
Data Using ODP.NET</code></p>
      <p class="tabletext"><code class="nocolor">DataSet</code> is a
major component         of ADO.NET. It is an in-memory cache of the
data retrieved from the database. <code class="nocolor">OracleDataAdapter</code>&nbsp;
represents a set         of data commands and a database connection
that is used to fill the <code class="nocolor">DataSet</code> based on
the query given.&nbsp; <code class="nocolor">OracleCommand</code>
represents SQL statements to execute against datasource. <code
 class="nocolor">OracleConnection</code> is used to build the database
connection.&nbsp; </p>
      <p class="tabletext"><code class="nocolor">OracleDataReader</code>
is a read-only,&nbsp;         forward-only recordset. <code
 class="nocolor">ExecuteReader</code> method of&nbsp; <code
 class="nocolor">OracleCommand</code> is used to create <code
 class="nocolor">OracleDataReader</code>. <code class="nocolor">OracleBLOB</code>
is an OracleType specific to ODP.NET for accessing BLOB data from Oracle
databases. </p>
      <p class="tabletext">This sample is used to create/update/view
advertisements         for products. When this sample is run, a drop
down list populated with         products is displayed.The user can
select a product from the list for         which he/she wishes to
create/update the advertisement.&nbsp; The user         can create a
new advertisement or update an existing one by entering advertisement 
text in the text box and selecting image from the file-dialog, by
clicking         the 'Browse' button. 'Save' button can be clicked to
commit changes and         'Close' button can be clicked to exit out
of the application.&nbsp;Creating         and updating advertisements
demonstrates DML operations on <code class="nocolor">DataSet</code> for
LOB data through Oracle Data Provider for .NET. Viewing advertisements
 demonstrates fetching&nbsp; BLOB (LOB) data using <code class="nocolor">OracleBLOB</code>
(ODP.NET type). </p>
      <p>
      <table border="0" width="100%">
        <tbody>
          <tr>
            <td width="61%">
            <h2 class="heading2"> <a name="usernotes"></a> User Notes
with Screen               Shots</h2>
            </td>
            <td width="39%" align="right"> <a href="#SAMPLE_NAME"
 class="paragraph"> Back To Top</a> </td>
          </tr>
        </tbody>
      </table>
      </p>
      <p class="tabletext"><span text="" class="OTN_TEXT">When this
sample application         is run, a list of products populated from
database is displayed. If the         advertisement&nbsp;text and
image already exists for the selected product         then
advertisement text and image is displayed as shown in figure 1.2&nbsp;</span> </p>
      <p><span class="OTN_TEXT"><img src="images/screenshot1.gif"
 height="454" width="597"><br>
      </span></p>
      <p><code class="nocolor">Figure 1.2 Screen Shot for Manipulate
Advertisement         Sample Initial Screen</code></p>
      <p><span class="tabletext">To insert/update an advertisement for
a product         selected from the list, the user can enter the value
of Advertisement         text.&nbsp; To select an image for the
advertisement, the user can click         on 'Browse' button. A file
dialog is displayed as shown in figure 1.3.</span>&nbsp; </p>
      <p>&nbsp;<img src="images/ScreenShot2.gif" height="456"
 width="600"></p>
      <p><code class="nocolor">Figure 1.3 Screen Shot displaying File
Dialog Box         For Image &nbsp; </code></p>
      <p><span class="tabletext">The selected image appears in the 'New
Ad Image'         picture box as shown in</span> <code class="nocolor">figure
1.4</code> . <span class="tabletext">The         user can
commit&nbsp;the changes by clicking the 'Save' button.</span></p>
      <p><img src="images/ScreenShot3.gif" height="456" width="600"></p>
      <p><code class="nocolor">Figure 1.4 Screen Shot After Selecting
Image From File Dialog Box&nbsp; </code></p>
      <p><span class="tabletext">&nbsp;The user can click on 'Close'
button to         exit from the application.</span> </p>
      <table border="0" width="100%">
        <tbody>
          <tr>
            <td width="61%">
            <h2 class="heading2"> <a name="software"></a> Required
Software</h2>
            </td>
            <td width="39%" align="right"> <a href="#SAMPLE_NAME"
 class="paragraph">Back             To Top</a> </td>
          </tr>
        </tbody>
      </table>
      <ul>
        <li>
          <p><span text="text" class="tabletext">Visual C# installed
with Visual
Studio 2005/2008/2010/2012</span></p>
        </li>
        <li>
          <p><span text="text" class="tabletext"><font
 face="Arial,Helvetica">Oracle11g Database or higher running
SQL*Net TCP/IP listener (can be downloaded <a
 href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html">here</a> )</font> </span></p>
        </li>
        <li>
          <p><span text="text" class="tabletext"><font
 face="Arial,Helvetica">Oracle             Data Provider for .NET
(ODP.NET) (can be downloaded <a
 href="http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html">here</a> )</font></span> </p>
        </li>
      </ul>
      <table border="0" width="100%">
        <tbody>
          <tr>
            <td width="61%">
            <h2 class="heading2"> <a name="extract"></a> Extracting the
Sample </h2>
            </td>
            <td width="39%" align="right"> <a href="#SAMPLE_NAME"
 class="paragraph">Back             To Top</a> </td>
          </tr>
        </tbody>
      </table>
      <p class="paragraph"><span text="" class="OTN_TEXT">Unzip <code
 class="nocolor"><span text="" class="OTN_TEXT">DSDRwithLOB.zip</span></code>
using Winzip or command utility to your convenient directory </span><span
 class="OTN_TEXT">referred         to as </span><span
 class="PropertyName"><code class="nocolor">&lt;Extract_Dir&gt;</code></span><span
 text="" class="OTN_TEXT">.         Extraction of the zip file
results&nbsp;in the creation of <code class="nocolor">'</code><code
 class="nocolor"><span text="" class="OTN_TEXT">DSDRwithLOB</span>'</code>
directory.&nbsp; </span><span class="OTN_TEXT">Refer <a
 href="#descsamples">Description         of Sample Files</a> section
for more details.&nbsp;</span> &nbsp; &nbsp; </p>
      <table border="0" width="100%">
        <tbody>
          <tr>
            <td width="61%">
            <h2 class="heading2"> <a name="database"></a> Database Setup</h2>
            </td>
            <td width="39%" align="right"> <a href="#SAMPLE_NAME"
 class="paragraph">Back             To Top</a> </td>
          </tr>
        </tbody>
      </table>
      <p><font face="Arial, Helvetica, sans-serif"><span
 class="tabletext">Connect         to your database as any user and
run the script</span> <code class="nocolor">&lt;Extract_Dir&gt;\DSDRwithLOB\Setup\DatabaseSetup.sql</code> <span
 class="tabletext">at the&nbsp;</span></font><span class="tabletext"><font
 face="Arial, Helvetica, sans-serif">SQL         prompt</font> </span><br>
      <tt><font face="Arial, Helvetica, sans-serif"><span class="code">SQL&gt;
@<code class="nocolor">&lt;Extract_Dir&gt;</code>\DSDRwithLOB\Setup\DatabaseSetup.sql</span></font></tt> </p>
      <p class="tabletext">This script will prompt for the username,
password         and connectstring. You may choose any existing
username. F<font face="Arial, Helvetica, sans-serif">ollowing        
database objects will get created by running <span class="code">DatabaseSetup.sql</span></font>
file.&nbsp; </p>
      <table border="0" width="73%" class="tabletext">
        <tbody>
          <tr>
            <td width="16%" class="tabletext"><b>Object Name</b></td>
            <td width="84%" class="tabletext"><b>Description</b></td>
          </tr>
          <tr>
            <td width="16%" class="tabletext">Products</td>
            <td width="84%" class="tabletext">Table that store
information about             products.</td>
          </tr>
          <tr>
            <td width="16%" class="tabletext">Printmedia</td>
            <td width="84%" class="tabletext">Table that stores
information about             the advertisement related to products.</td>
          </tr>
          <tr>
            <td width="16%" class="tabletext">Adid_seq</td>
            <td width="84%" class="tabletext">Sequence for auto
generating Advertisement             ID.</td>
          </tr>
          <tr>
            <td class="tabletext" width="16%">Populate_AdID</td>
            <td class="tabletext" width="84%">Trigger for
populating&nbsp; Ad_ID             column of 'PrintMedia'&nbsp; table
on insertion.</td>
          </tr>
        </tbody>
      </table>
      <p>
      <table border="0" width="100%">
        <tbody>
          <tr>
            <td width="61%">
            <h2 class="heading2"> <a name="prepare"></a> Preparing and
Running               the Sample</h2>
            </td>
            <td width="39%" align="right"> <a href="#SAMPLE_NAME"
 class="paragraph">Back             To Top</a> </td>
          </tr>
        </tbody>
      </table>
      </p>
      <p class="paragraph"><span text="" class="OTN_TEXT">1. Ensure
that the <a href="#database">Database         setup</a> has been
completed.&nbsp; </span></p>
      <p class="paragraph"><span text="" class="OTN_TEXT">2. Open <code
 class="nocolor">DSDRwithLOB.sln</code> using Visual Studio .NET from </span><span
 class="PropertyName"><code class="nocolor">&lt;Extract_Dir&gt;</code></span><span
 text="" class="OTN_TEXT"><code class="nocolor">\DSDRwithLOB</code>
folder.&nbsp; </span></p>
      <p class="paragraph"><span text="" class="OTN_TEXT">3. Edit <code
 class="nocolor">ConnectionParams.cs</code> file to change the database
connection parameters i.e.Username, Password,         TNSName for
database .You need to input the same values of connection        
parameters as given while doing the Database Setup. Save this file. </span></p>
      <p></p>
      <p><span text="text" class="tabletext">4. Ensure that the
following .NET         Component References have been added to <code
 class="nocolor">DSDRwithLOB</code> project:&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System,&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.Data,&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.Drawing,&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.Windows.Forms,&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.XML, <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Oracle.ManagedDataAccess.&nbsp; </span> </p>
      <blockquote class="tabletext">To add the above .NET
Components&nbsp; <br>
a)Go to Menu -&gt;View-&gt; Solution Explorer.&nbsp; <br>
b)Right click on <code class="nocolor">DSDRwithLOB</code> project,
choose 'Add Reference'.&nbsp; <br>
c)Choose the above .NET Components from the list displayed.&nbsp; <br>
d)Click 'Select', then OK.&nbsp; <br>
e) The chosen .NET component gets added to the project.&nbsp;</blockquote>
      <p class="paragraph"><span text="" class="OTN_TEXT">5. Build and
run the sample. </span></p>
      <table border="0" width="100%">
        <tbody>
          <tr>
            <td width="58%">
            <h2 class="heading2"> <a name="descsamples"></a> Description
of Sample               Files</h2>
            </td>
            <td width="42%" align="right"> <a href="#SAMPLE_NAME"
 class="paragraph">Back             To Top</a> </td>
          </tr>
        </tbody>
      </table>
      <p><span class="paragraph">Following is the directory structure
of the </span><span text="" class="OTN_TEXT"><code class="nocolor">DSDRwithLOB.zip</code> </span><span
 class="paragraph"><code class="nocolor"> : </code></span></p>
      <table border="1" cols="3" width="98%" class="tabletext">
        <tbody>
          <tr>
            <td width="21%"><b>Directory</b></td>
            <td width="18%"><b>File Name</b></td>
            <td width="61%"><b>Description</b></td>
          </tr>
          <tr>
            <td rowspan="2" class="OTN_TEXT" width="21%"><code
 class="nocolor">DSDRwithLOB\doc</code></td>
            <td class="tabletext" width="18%">Readme.html</td>
            <td class="tabletext" width="61%">This file</td>
          </tr>
          <tr>
            <td class="tabletext" width="18%">otn.css</td>
            <td class="tabletext" width="61%">This is a cascading
stylesheet applied             to Readme.html</td>
          </tr>
          <tr>
            <td class="OTN_TEXT" width="21%"><code class="nocolor">DSDRwithLOB\doc\images</code></td>
            <td width="18%" class="tabletext">*.gif</td>
            <td width="61%" class="tabletext">This folder contains
images used in             the Readme.html file</td>
          </tr>
          <tr>
            <td class="OTN_TEXT" rowspan="5" width="21%" colspan="1"><code
 class="nocolor">DSDRwithLOB\src\</code><code class="nocolor"></code></td>
            <td class="tabletext" width="18%">ConnectionParams.cs</td>
            <td class="tabletext" width="61%">This C# file contains
parameters for             database connection</td>
          </tr>
          <tr>
            <td class="tabletext" width="18%">ManipulateAds.cs</td>
            <td class="tabletext" width="61%">This C# file contains
source code             for UI for sample application and its
functionality</td>
          </tr>
          <tr>
            <td class="tabletext" width="18%">DSDRwithLOB.csproj</td>
            <td class="tabletext" width="61%">C# project file</td>
          </tr>
          <tr>
            <td class="tabletext" width="18%">ManipulateAds.resx</td>
            <td class="tabletext" width="61%">.NET XML Resource
Template (this file             gets automatically generated when a
Visual Studio Project is created)</td>
          </tr>
          <tr>
            <td style="vertical-align: top;">DSDRwithLOB.sln</td>
            <td style="vertical-align: top;">Visual Studio Solution</td>
          </tr>
          <tr>
            <td class="OTN_TEXT" width="21%"><code class="nocolor">DSDRwithLOB\Setup</code></td>
            <td class="tabletext" width="18%">DatabaseSetup.sql</td>
            <td class="tabletext" width="61%">This is a SQL script
file&nbsp;</td>
          </tr>
        </tbody>
      </table>
      </td>
				</tr>
			
  </tbody> 		
</table>
	
</body>
</html>
